﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Ovvio.Business;
using Ovvio.Data;
using System.ComponentModel.DataAnnotations;
using Ovvio.Web.Core;
using System.ComponentModel;
using System.Web.Mvc;

namespace Ovvio.Web.Areas.Admin.Models
{
    public class RatingModel : BaseModel<ProductRating>
    {
        [ScaffoldColumn(false)]
        public int Id { get { return Entity.Id; } set { Entity.Id = value; } }

        [Required]
        [DisplayName("Rating")]
        public int Value { get { return Entity.Rating; } set { Entity.Rating = value; } }

        [Required]
        public string Description { get { return Entity.Description; } set { Entity.Description = value; } }

        //public SelectList Ratings
        //{
        //    get
        //    {
        //        return CreateList<ProductRating, OvvioDataContext>("Id", "Description", p => p.Id == this.Id);
        //    }
        //}

        public static List<RatingModel> Ratings
        {
            get
            {
                return CreateList<RatingModel, ProductRating, OvvioDataContext>();
            }   
        }
    }
}
